import yaml


class YamlOperation:

    def __init__(self, path='../../config/CrmLocator.yaml'):
        with open(path, encoding='utf-8') as fp:
            self.data = yaml.load(fp, Loader=yaml.FullLoader)  # 用yaml的方式运行文件

    def get_locator(self, page, name):
        return self.data[page][name]

# yo=YamlOperation('../../data.yaml')
# print(yo.get_locator('LoginPage','username'))
